#ifndef UNIT_H_INCLUDED
#define UNIT_H_INCLUDED
#define PI 3.14
#include <iostream>
#include <cmath>
#include <typeindex>
#include <SFML\System.hpp>
#include <SFML\Graphics.hpp>
#include <SFML\Window.hpp>

class Level;
class ImgMgr;
class Struct;
class RessourceStruct;

class Unit
{
public:
	Unit();
	virtual void init(const int idTeam, const sf::Vector2f position, ImgMgr *imageManager);
	virtual void maj(Level *level);
	virtual void render(sf::RenderWindow *app);
	sf::Vector2f getPosition() const;
	bool getDead() const;
	void setDirection(const float angle);
	void setDommage(const float degat);
	int random(int a, int b);

protected:
	int m_idTeam;
	int m_currentRender;
	sf::Clock m_clockFrame;
	sf::Clock m_clockDirection;
	sf::Sprite m_skin[12];
	bool m_dead;
	sf::RectangleShape m_shadow;
	sf::RectangleShape m_barHealth;
	int m_direction;
	int m_changeDirection;
	float m_moveX;
	float m_moveY;
	float m_speed;
	float m_degat;
	float m_health;
	float m_originHealth;
};



#endif